package com.rfsp.common.util;


import org.bouncycastle.util.encoders.Base64;

/**
 * 对外提供的加密解密的类，保持兼容性
 * @author zhangchao
 * @since jdk1.5
 */
public class Base64Util {

	public static byte[] encode(byte[] data) {
		return Base64.toBase64String(data).getBytes();
	}
	
	public static String encode(String data) {
		return Base64.toBase64String(data.getBytes());
	}

	public static String decode(String data) {
		byte[] bArr = Base64.decode(data.getBytes());
		return new String(bArr);
	}
	
	public static byte[] decode(byte[] data) {
		return Base64.decode(data);
	}
	
}  